<template>
    <div class="app-container">
      <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
        <el-form-item label="被取保候审人(被行政拘留人)" prop="hsr">
          <el-input v-model="queryParams.hsr" placeholder="请输入被取保候审人(被行政拘留人)" clearable @keyup.enter.native="handleQuery" />
        </el-form-item>
      <el-form-item label="案件编号">
        <el-input v-model="queryParams.ajbh" placeholder="请输入案件编号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
        <!-- <el-form-item label="审核状态" prop="msshzt">
            <el-select v-model="queryParams.msshzt" clearable  placeholder="请选择审核状态">
                <el-option
                v-for="item in options"
                :key="item.msshzt"
                :label="item.label"
                :value="item.msshzt">
                </el-option>
            </el-select>
          </el-form-item> -->
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
        </el-form-item>
    <el-form-item>
      <el-radio-group v-model="queryParams.msshzt">  
      <el-radio label="1" @change="handleQuery">待审核</el-radio>
      <el-radio label="4" @change="handleQuery">已审核</el-radio>
      <el-radio label="5" @change="handleQuery">待办结</el-radio>
      </el-radio-group>
    </el-form-item>
      </el-form>
      <!-- <el-row :gutter="10" class="mb8">
        <el-col :span="1.5">
          <div style="margin-top: 5px;">
            <el-col :span="1.5">
              <el-button type="success" plain icon="el-icon-success" size="mini" :disabled="!form.ajmc" @click="handleSuccess" >通过</el-button>
              <el-button type="danger" plain icon="el-icon-error" size="mini" :disabled="!form.ajmc" @click="handleBack" >退回</el-button>
            </el-col>
            <el-col :span="1.5">
              <el-button type="success" plain icon="el-icon-upload" size="mini" :disabled="!form.xh" @click="handleYwbj">业务办结</el-button>
            </el-col>
          </div>
        </el-col>
        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
      </el-row> -->
  
      <el-table v-loading="loading" height="650" :data="bzjtableList" :row-class-name="tableRowClassName" @current-change="tableCurrentChange" @row-dblclick="doubleclick">
        <el-table-column label="序号" align="center" prop="xh" />
        <el-table-column label="审核状态" align="center" width="150">
            <template slot-scope="scope">
                <el-tag :type="`${scope.row.msshzt == 1 ? 'danger' : scope.row.msshzt == 4 ? 'success' : scope.row.msshzt == 5 ? 'primary' : ''}`">{{ scope.row.msshzt == 1 ?
                    `待审核` : scope.row.msshzt == 4 ? `已审核` : scope.row.msshzt == 5 ? `待办结` : ''}}</el-tag>
            </template>
        </el-table-column>
        <el-table-column label="案件编号" align="center" prop="ajbh"  width="200"/>
        <el-table-column label="案件名称" align="center" prop="ajmc"  width="200"/>
        <el-table-column label="被取保候审人(被行政拘留人)" align="center" prop="hsr" width="100" />
        <el-table-column label="性别" align="center" prop="xb" />
        <el-table-column label="出生日期" align="center" prop="csrq" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.csrq, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <!-- <el-table-column label="住址" align="center" prop="zz" width="200" /> -->
        <el-table-column label="户籍地址" align="center" prop="hjdz" width="200" />
        <!-- <el-table-column label="单位及职务" align="center" prop="dwzw" width="150" /> -->
        <el-table-column label="联系电话" align="center" prop="lxdh" width="120" />
        <el-table-column label="保证金金额" align="center" prop="sqje" width="100" />
        <el-table-column label="收费方式" align="center" prop="sqfs" />
        <el-table-column label="没收法律文书号" align="center" prop="mswsh" width="150px"/>
        <el-table-column label="没收账户名称" align="center" prop="mszhmc" />
        <el-table-column label="没收开户行" align="center" prop="mskhh" />
        <el-table-column label="没收银行账号" align="center" prop="msyhzh" />        
        <el-table-column label="没收金额" align="center" prop="msje" />
        <!-- <el-table-column label="没收状态" align="center" prop="mszt">
          <template slot-scope="scope">
            {{ scope.row.mszt == 0 ? '待没收' : scope.row.mszt == 1 ? '银行未扣款' : scope.row.mszt == 2
            ? '银行已扣款' : '' }}
          </template>
        </el-table-column> -->
        <!-- <el-table-column label="没收原因" align="center" prop="msyy" /> -->
        <el-table-column label="没收批准时间" align="center" prop="mspzsj" width="180" />
        <el-table-column label="办案人" align="center" prop="mstfr" width="100" />
        <el-table-column label="办案人联系方式" align="center" prop="mstfrlxfs" width="100" />
        <!-- <el-table-column label="没收日期" align="center" prop="msrq" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.msrq, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column> -->
        <el-table-column label="没收填报时间" align="center" prop="mstfsj" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.mstfsj, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <!-- <el-table-column label="没收审核状态" align="center" prop="msshzt" width="120">
          <template slot-scope="scope">
            {{ scope.row.msshzt == 0 ? '待没收' : scope.row.msshzt == 1 ? '待审核' : scope.row.msshzt
            == 2
            ? '已通过' : scope.row.msshzt == 3 ? '退回' : '' }}
          </template>
        </el-table-column>
        <el-table-column label="没收银行扣款状态 " align="center" prop="mskhzt" width="130">
          <template slot-scope="scope">
            <span>{{ scope.row.mskhzt ? '已扣款' : '未扣款' }}</span>
          </template>
        </el-table-column> -->
        <el-table-column label="没收银行扣款时间" align="center" prop="mskhsj" width="180" />
        <!-- <el-table-column label="没收银行扣款操作人" align="center" prop="mskhczr" width="150" /> -->
        <!-- <el-table-column fixed="right" label="操作"  align="center"  width="220" >
          <template slot-scope="scope">
              <el-button type="warning" plain size="mini" @click="handleckfj(scope.row)">查看附件</el-button>
              <el-button type="primary" plain size="mini" @click="handlecklc(scope.row)" >查看流程</el-button>
  
          </template>
        </el-table-column> -->
      </el-table>
      <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
      <el-dialog :visible.sync="pdfs" width="45%">
           <div style="display: flex;align-items: center;justify-content: center;">
            <img :src="this.pdfUrl" alt width="80%" />
           </div>
      </el-dialog>
      <el-dialog title="查看附件" :visible.sync="dialogFormVisible">
        <el-table height="600" border :data="fileList" :header-cell-style="{ backgroundColor: 'rgb(237 237 237)'}">
          <el-table-column label="文件名称" prop="fjmc" />
          <el-table-column label="环节" prop="lb" />
          <el-table-column label="文件类型" prop="wjlx" />
          <el-table-column fixed="right" label="操作" width="200">
            <template slot-scope="scope">
              <el-button type="success" plain size="mini" @click="handlexzfj(scope.row)" :disabled="!scope.row.wjdz" >下载附件</el-button>
              <el-button type="success" plain size="mini" @click="yul(scope.row)" :disabled="!(scope.row.wjdz.split('.')[1] == 'png' || scope.row.wjdz.split('.')[1] == 'jpg' || scope.row.wjdz.split('.')[1] == 'jpeg')" >预览</el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-dialog>
      <el-dialog title="查看流程" :visible.sync="dialogFlowerTable"  @closed="dialogFlowerTable=false">
        <el-table height="600" border :data="flowerList" :header-cell-style="{ backgroundColor: 'rgb(237 237 237)'}">
          <el-table-column label="案件类别" prop="lb" hidden/>
          <el-table-column label="审批环节" prop="ajlx" />
          <el-table-column label="审批意见" prop="spyj" width="200"/>
          <el-table-column label="审批人" prop="spr" />
          <el-table-column label="审批人职务" prop="sprzw" width="100"/>
          <el-table-column label="审批单位" prop="spdw" width="200"/>
          <el-table-column label="审批时间" prop="spsj" width="180"/>
        </el-table>
      </el-dialog>
      <el-dialog :title="title" :visible.sync="dialogShenHe">
        <div style="display: flex;align-items: stretch;justify-content: space-evenly;flex-direction: column;height: 220px;">
  
          <div style="display: flex;align-items: center;justify-content: center;">
          <div>审批意见:</div>
          <el-input v-model="spyj" style="width: 85%;" :rows="5" type="textarea"></el-input>
        </div>
        <div style="display: flex;align-items: center;justify-content: center;">
          <div style="margin-left: 11px;">审批人:</div>
          <el-input v-model="spr" style="width: 40%;" :rows="5" type="text"></el-input>
          <div style="margin-left: 11px;">职务:</div>
          <el-select v-model="sprzw" style="width: 40%;" :rows="5" type="text"  clearable  placeholder="请选择职务">
            <el-option
          v-for="item in dict.type.sys_sprzw"
          :key="item.value"
          :label="item.label"
          :value="item.label"/>
            </el-select>    
      </div>  
        </div>
        <div style="display: flex;align-items: center;justify-content: center;" v-if="title === '审核通过'">
          <Upload v-model="form.files" :data="{}" acceptTip="*仅图片、PDF类型文件可在线预览"
            multiple></Upload>        
          </div>
        <div slot="footer" class="dialog-footer">
          <el-button type="primary" @click="submitForm">确 定</el-button>
          <el-button @click="dialogShenHe=false">取 消</el-button>
        </div>
      </el-dialog>

      <el-dialog :title="tit" :visible.sync="open" width="80%" @closed="gb">
        <el-form ref="form" :inline="true" :model="form" :rules="ruless" label-width="auto" :hide-required-asterisk="true"  class="creation demo-form-inline">
          <el-row :gutter="20">
            <el-col :span="24">
            <el-divider content-position="center">案件信息</el-divider>
          </el-col>
          <el-col :span="8">
          <el-form-item label="案件编号" prop="ajbh">
            <el-input v-model="form.ajbh" :disabled="true"/>
          </el-form-item>
          </el-col>
          <el-col :span="8">
          <el-form-item label="案件名称" prop="ajmc">
            <el-input v-model="form.ajmc"  :disabled="true"/>
          </el-form-item>
        </el-col>
          <el-col :span="8">
          <el-form-item label="案件性质" prop="ajxz">
            <el-input v-model="form.ajxz" :disabled="true"/>
          </el-form-item>
        </el-col>
          <el-col :span="8">
          <el-form-item label="收取办案人" prop="bar">
            <el-input v-model="form.bar" :disabled="true"/>
          </el-form-item>
        </el-col>
          <el-col :span="8">
          <el-form-item label="办案单位" prop="badw">
            <el-input v-model="form.badw"  :disabled="true" />
          </el-form-item>
        </el-col>
          <el-col :span="8">
          <el-form-item label="没收法律文书号" prop="mswsh">
            <el-input v-model="form.mswsh"  :disabled="true"/>
          </el-form-item>
        </el-col>
          <el-col :span="8">
          <el-form-item label="取保候审批准时间" prop="pzsj">
            <el-date-picker clearable
              v-model="form.pzsj"
              type="date"
              value-format="yyyy-MM-dd"
              :disabled="true">
            </el-date-picker>
          </el-form-item>
        </el-col>
          <el-col :span="8">
          <el-form-item label="被取保候审人(被行政拘留人)" prop="hsr">
            <el-input v-model="form.hsr"  :disabled="true" />
          </el-form-item>
        </el-col>
          <el-col :span="8">
          <el-form-item label="人员类别" prop="xjr">
            <el-input v-model="form.xjr"  :disabled="true" />
          </el-form-item>
        </el-col>
          <el-col :span="8">
          <el-form-item label="性别" prop="xb">
            <el-input v-model="form.xb"  :disabled="true" />
          </el-form-item>
        </el-col>
          <el-col :span="8">
          <el-form-item label="出生日期" prop="csrq">
            <el-date-picker clearable
              v-model="form.csrq"
              type="date"
              value-format="yyyy-MM-dd"
              :disabled="true">
            </el-date-picker>
          </el-form-item>
        </el-col>
          <el-col :span="8">
          <el-form-item label="户籍地址" prop="hjdz">
            <el-input v-model="form.hjdz"  :disabled="true" />
          </el-form-item>
        </el-col>
          <el-col :span="8">
          <el-form-item label="联系电话" prop="lxdh">
            <el-input v-model="form.lxdh"  :disabled="true"/>
          </el-form-item>
        </el-col>
          <el-col :span="8">
          <el-form-item label="身份证号" prop="sfzh">
            <el-input v-model="form.sfzh"  :disabled="true"/>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-divider content-position="center">没收信息</el-divider>
        </el-col>
          <el-col :span="8">
          <el-form-item label="保证金金额" prop="sqje">
            <el-input v-model="form.sqje"  :disabled="true" />
          </el-form-item>
        </el-col>
          <el-col :span="8">
          <el-form-item label="没收金额" prop="msje">
            <el-input v-model="form.msje"  :disabled="true"/>
          </el-form-item>
        </el-col>
        <el-col :span="8" >
        <el-form-item label="没收账户名称" prop="mszhmc">
          <el-input v-model="form.mszhmc" placeholder="请输入没收账户名称"/>
        </el-form-item>
        </el-col>
        <el-col :span="8" >
        <el-form-item label="没收开户行" prop="mskhh">
          <el-input v-model="form.mskhh" placeholder="请输入没收开户行" />
        </el-form-item>
        </el-col>
        <el-col :span="8" >
        <el-form-item label="没收银行账号" prop="msyhzh">
          <el-input v-model="form.msyhzh" placeholder="请输入没收银行账号"/>
        </el-form-item>
        </el-col>
        <el-col :span="8" >
        <el-form-item label="没收决定文书号" prop="mswsh">
          <el-input v-model="form.mswsh" placeholder="请输入没收决定文书号"/>
        </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="办案人" prop="mstfr">
            <el-input v-model="form.mstfr"  :disabled="true"/>
        </el-form-item>
      </el-col>
        <el-col :span="8">
          <el-form-item label="办案人联系方式" >
            <el-input v-model="form.mstfrlxfs"  :disabled="true"/>
        </el-form-item>
      </el-col>
          <el-col :span="8">
          <el-form-item label="没收填报时间" prop="mstfsj">
            <el-date-picker clearable  v-model="form.mstfsj"  type="date"  value-format="yyyy-MM-dd"  :disabled="true">
            </el-date-picker>
          </el-form-item>
        </el-col>
          <el-col :span="8">
          <el-form-item label="没收批准人" prop="mspzr">
            <el-input v-model="form.mspzr" :disabled="true"/>
          </el-form-item>
        </el-col>
          <el-col :span="8">
          <el-form-item label="没收批准时间" prop="mspzsj">
            <el-input v-model="form.mspzsj"  :disabled="true" />
          </el-form-item>
        </el-col>
          <!-- <el-col :span="8">
          <el-form-item label="没收日期" prop="msrq">
            <el-date-picker clearable
              v-model="form.msrq"
              type="date"
              value-format="yyyy-MM-dd"
              :disabled="true">
            </el-date-picker>
          </el-form-item>
        </el-col> -->
          </el-row>
        </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="success" plain icon="el-icon-success" :disabled="!form.ajmc" @click="handleSuccess" >通过</el-button>
        <el-button type="danger"  plain icon="el-icon-error" :disabled="!form.ajmc" @click="handleBack" >退回</el-button>
        <el-button type="primary" plain icon="el-icon-upload" :disabled="!form.xh" @click="handleYwbj">业务办结</el-button>
        <el-button type="warning" @click="handleckfj(form)">查看附件</el-button>
        <el-button type="primary" @click="handlecklc(form)" >查看流程</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    </div>
  </template>
    
  <script>
  import { mssh, selectMscwshList, downLoadFile, getFileTableList, getFjList ,getListByXhDetail,Ywbj} from "@/api/system/bzjtable";
  import selectMultiple from '@/views/collect/addSecurity/selectMultiple'
  import Upload from './DzpjUpload'
  import Print from '@/utils/print.js'
  import { shBack } from "../../../api/system/bzjtable";
  import { tansParams, blobValidate } from "@/utils/ruoyi";
  
  import XLSX from 'xlsx';//引入
  import { saveAs } from 'file-saver'
  import pdf from "vue-pdf"
  export default {
    name: "Bzjtable",
    dicts: ['sys_type','sys_sprzw'],
    data() {
      return {
        flowerList:[],
        dialogFlowerTable:false,
        spyj:'',
        spr:'',
        sprzw:'',
        title:'',
        dialogShenHe:false,
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        fileList: [],
        directoryList: [],
        fileTableList: [],
        clickedRowData: null,
        pdfs: false,
        isShow: false,
        dialogFormVisible: false,
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        // 【请填写功能名称】表格数据
        bzjtableList: [],
        // 弹出层标题
        tit: "",
        // 是否显示弹出层
        open: false,
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          msshzt: '1',
          hsr: null,
          ajbh:null
        },
        pdfUrl: '',
        // formInfo: {},
        wjdz: '',
        // 表单参数
        form: {
          lxdh: '',
          sfzh: '',
        },
        currentIndex: '',
        options: [{
            msshzt: '1',
          label: '待审核'
        }, {
            msshzt: '5',
          label: '待办结'
        }],
        msshzt: '',
      };
    },
    components: {
      selectMultiple,
      Upload,
      pdf
    },
    created() {
      this.getList();
    },
    methods: {
      /** 查询【请填写功能名称】列表 */
      getList() {
        this.loading = true;
        selectMscwshList(this.queryParams).then(response => {
          response.rows.forEach((item, index) => {
            item.pIndex = index + 1
          })
          this.bzjtableList = response.rows;
          this.total = response.total;
          this.loading = false;
        });
      },
      // 取消按钮
      cancel() {
        this.open = false;
        this.getList();
        this.reset();
      },
      // 表单重置
      reset() {
        this.form = {
          xh: null,
          ajbh: null,
          ajmc: null,
          sqwsh: null,
          hsr: null,
          xjr: null,
          xb: null,
          csrq: null,
          zz: null,
          hjdz: null,
          dwzw: null,
          lxdh: null,
          sfzh: null,
          ajxz: null,
          sqje: null,
          sqfs: null,
          sqzt: null,
          jkr: null,
          jkrsfz: null,
          dsyhbh: null,
          jnsj: null,
          jnkh: null,
          pzr: null,
          pzsj: null,
          bar: null,
          dwbh: null,
          badw: null,
          sqrq: null,
          sqtfsj: this.getNowFormatDate(),
          sqtfr: this.$store.state.user.name,
          msje: null,
          mszt: null,
          msyy: null,
          mswsh: null,
          mspzr: null,
          mspzsj: null,
          mstfr: null,
          msrq: null,
          mstfsj: null,
          msshzt: null,
          mskhzt: null,
          mskhsj: null,
          mskhczr: null,
          thje: null,
          thfs: null,
          thzt: null,
          thrq: null,
          thwsh: null,
          thpzr: null,
          thtfsj: null,
          thshzt: null,
          thshr: null,
          thshsj: null,
          thxm: null,
          thzh: null,
          thkhh: null,
          djzt: null,
          sqdyzt: null,
          djsj: null,
          sqkpzt: null,
          thkpzt: null,
          hbwsh: null,
          hbdw: null,
          hbje: null,
          hbry: null,
          hbrq: null,
          hblxdh: null,
          hbsj: null,
          hbczy: null
        };
        this.resetForm("forms");
      },
      tableRowClassName({ row, column, rowIndex, columnIndex }) {
        //逻辑判断决定是否修改样式，如果分组一致则使用同一个样式
        return row.pIndex == this.currentIndex ? 'hover-bg' : ''
      },
      tableCurrentChange(row) {
        // this.form = row
        // this.queryParams.xh = row.xh
        // this.wjdz = row.wjdz
        // this.currentIndex = row?.pIndex
        // this.$forceUpdate()
      },
      /** 搜索按钮操作 */
      handleQuery() {
        // let ogj = {}
        // ogj.xh = this.queryParams.xh
        // ogj.msshzt = this.queryParams.msshzt
  
  
        this.queryParams.pageNum = 1
        this.getList()
      },
      handleSuccess() {
        const CANNOT_COMPLETE =this.form.msshzt
        if (CANNOT_COMPLETE === "5") {  
          return this.$message.error('当前业务不可审核')
        }else{
          this.title = '审核通过'
        this.dialogShenHe = true
        }
      },
      handleYwbj(){
        debugger
        const CANNOT_COMPLETE =this.form.msshzt
        if (CANNOT_COMPLETE === "1" || CANNOT_COMPLETE === "4") {  
          return this.$message.error('当前业务不可办结')
        }else{
        let ogj = {}
        ogj.xh = this.form.xh
        ogj.ajmc = this.form.ajmc
        ogj.ajbh = this.form.ajbh
        Ywbj(ogj).then(() => {
          this.$modal.msgSuccess("业务已办结")
          this.open=false
          this.getList()
          })
        }
      },
      submitForm() { 
        if(!this.spyj){
          return this.$message.error('请输入审核意见')
        }
        if(!this.spr){
          return this.$message.error('请输入审核人')
        }
        if(!this.sprzw){
          return this.$message.error('请选择审批人职务')
        }
        this.form.files.forEach((item)=>{
          item.wjlx = item.fileType
          console.log(item.fileType)
        })

        this.form.spyj = this.spyj
        this.form.spr = this.spr
        this.form.sprzw = this.sprzw
        this.form.msshzt = this.title == "审核通过"?4:3
        mssh(this.form).then(() => {
          this.$modal.msgSuccess(this.title == "审核通过"?"审核通过":'审核退回')
          this.getList()
        // })
            this.dialogShenHe = false
            this.open=false
            this.getList()
          })
      },
      handleBack() {
        const CANNOT_COMPLETE =this.form.msshzt
        if (CANNOT_COMPLETE === "5") {  
          return this.$message.error('当前业务不可退回')
        }else{
        this.title = '审核退回'
        this.dialogShenHe = true
        }
      },
      yul(val) {
        downLoadFile({ wjdz: val.wjdz }).then(async (data) => {
          // if (this.wjdz && this.wjdz.split('.')[1] == 'png' || this.wjdz &&this.wjdz.split('.')[1] == 'jpg' || this.wjdz.split('.')[1] == 'jpeg') {
            const url = window.URL.createObjectURL(data);
            this.pdfUrl = url;//直接用iframe标签
            this.pdfs = true
          // }
        })
      },
      handleckfj(row) {
        this.dialogFormVisible = true
        getFjList({ xh: row.xh }).then((res) => {
          this.fileList = res.rows
          // this.fileList.forEach((item) => {
          //   item.typeName = this.dict.type.sys_type.filter((e)=>item.wjlx==e.value)[0].label
          // })
        })
  
      },
      handlecklc(row) {
        this.dialogFlowerTable = true
        getListByXhDetail(row.xh,1).then((res) => {
          this.flowerList = res.rows
        })
      },
      handlexzfj(val) {
        // this.download('/confiscate/forfeitureOfDeposit/downLoadFile', { wjdz: this.form.wjdz }, `role_${new Date().getTime()}.png`)
        downLoadFile({ wjdz: val.wjdz }).then(async (data) => {
          this.$modal.msgSuccess("下载成功");
          const url = window.URL.createObjectURL(data);
          this.pdfUrl = url;//直接用iframe标签
          const isBlob = blobValidate(data);
          if (val.wjdz && val.wjdz.split('.')[1] == 'png' || val.wjdz &&val.wjdz.split('.')[1] == 'jpg' || val.wjdz &&val.wjdz.split('.')[1] == 'jpeg') {
            if (isBlob) {
              const blob = new Blob([data])
              saveAs(blob, `role_${new Date().getTime()}.png`)
            } else {
              const resText = await data.text();
              const rspObj = JSON.parse(resText);
              const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']
              Message.error(errMsg);
            }
          } else if (val.wjdz &&val.wjdz.split('.')[1] == 'pdf') {
            // let pdfUrl = window.URL.createObjectURL(new Blob([data], { type: "application/pdf" }));
            // window.open(pdfUrl)
            let blob = new Blob([data], { type: 'application/pdf' });
            let downloadElement = document.createElement("a");
            let href = window.URL.createObjectURL(blob); //创建下载的链接
            downloadElement.href = href;
            downloadElement.download = `pdf下载`    //下载后的文件名，根据需求定义
            document.body.appendChild(downloadElement);
            downloadElement.click(); //点击下载
            document.body.removeChild(downloadElement); //下载完成移除元素
            window.URL.revokeObjectURL(href); //释放掉blob对象
          } else {
            const blob = new Blob([data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }) // response就是接口返回的文件流
            const objectUrl = URL.createObjectURL(blob)
            const a = document.createElement('a') // 创建a标签
            a.href = objectUrl
            a.download = 'excel下载' // 自定义文件名
            a.click() // 下载文件
            window.URL.revokeObjectURL(objectUrl) // 释放内存
            // link.remove()
          }
          this.dialogFormVisible = false
        })
      },
      /**双击操作 */
      doubleclick(row,event){
      this.form = row;
      this.open = true;
    },
      /** 重置按钮操作 */
      resetQuery() {
        this.queryParams.hsr = ''
        this.queryParams.ajbh = ''
        this.queryParams.msshzt = '1'
        this.resetForm("queryForm");
        this.handleQuery();
      },
      // 多选框选中数据
      handleSelectionChange(selection) {
        this.ids = selection.map(item => item.xh)
        this.single = selection.length !== 1
        this.multiple = !selection.length
      },
    }
  };
  </script>
  <style rel="stylesheet/scss" lang="scss" scoped>
  .creation {
    .el-form-item {
      margin-bottom: 15px;
    }
  
    ::v-deep.el-input__inner {
      width: 250px;
    }
  
    // .xx {
    //   ::v-deep.el-input__inner {
    //     width: 630px;
    //   }
    // }
  }
  
  ::v-deep .el-table__body-wrapper::-webkit-srollbar-track {
    background-color: rgba(255, 255, 255, 0);
  }
  
  //可设置胶囊宽高
  ::v-deep .el-table__body-wrapper::-webkit-scrollbar {
    height: 12px;
    width: 10px;
    opacity: 0.5;
  }
  
  // 设置胶囊色
  ::v-deep .el-table__body-wrapper::-webkit-scrollbar-thumb {
    border-radius: 15px;
    background-color: #cdd9e6;
  }
  
  ::v-deep .el-table__body .el-table__row.hover-bg td {
    background-color: #cde6f7 !important;
  }
  </style>